{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 正态分布数据生成\n",
    "- 均值：$\\mu$\n",
    "- 方差: $\\sigma$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/opt/conda/lib/python3.7/site-packages/ipykernel_launcher.py:19: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3dfbRcdX3v8fcn4VgO+BC4RAwHYuySxgtUEslFXVlaiQ88CilWhXWrtLqaa692idfmGrS3gm1XY1O1tnqlKVBxlSJUICKgIUugFJcEEwiEmKRQi5CES2I1PEiUPHzvH7MnnUz2ntmzZ8/smTmf11pnnTN79p7fbzKZ7/zm9/D9KSIwM7PRNaXqCpiZWW850JuZjTgHejOzEedAb2Y24hzozcxG3CFVVyDNUUcdFbNmzaq6GpPe2rVrfxIR08t6PL+ug8Gv62hq9boOZKCfNWsWa9asqboak56kH5f5eH5dB4Nf19HU6nV1142Z2YhzoDczG3EO9GZmI86B3sxsxDnQm5mNOAd6M7MRN5DTK83MRs2KB7aybOVmtu3cxTHTxll8+mwWzp3oS9kO9GZmPbbiga1ccuN6du3eC8DWnbu45Mb1AH0J9u66MTPrsWUrN+8P8nW7du9l2crNfSnfLfoCZi25te05jy09uw81sX7za29FbNu5q6PjZXOL3sysx46ZNt7R8bI50JuZ9dji02czPjb1gGPjY1N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NuP8PTMGJ3Z2BBQ8AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 3 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from numpy.linalg import cholesky\n",
    "\n",
    "def create_data(mu, sigma, count):\n",
    "    dim = len(mu)\n",
    "    assert dim == len(sigma)\n",
    "    R = cholesky(sigma)\n",
    "    return np.dot(np.random.randn(count, dim), R) + mu\n",
    "\n",
    "def scatter_show(_x, _y, color='red'):\n",
    "    plt.scatter(_x, _y, color=color)\n",
    "    \n",
    "\n",
    "data = create_data([5, 30], [[1,0],[0, 2]], 100)\n",
    "plt.subplot(131)\n",
    "x = data[:,0]\n",
    "y = data[:,1]\n",
    "plt.subplot(131)\n",
    "plt.hist(x)\n",
    "plt.subplot(132)\n",
    "plt.hist(y)\n",
    "plt.subplot(133)\n",
    "plt.scatter(x, y)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 逻辑回归\n",
    "逻辑回归包含两个步骤\n",
    "- 线性转化\n",
    "- 概率转化\n",
    "\n",
    "## 线性转化\n",
    "$$\n",
    "f(x) = \\theta_0 + \\theta_1 x_1 + \\dots +\\theta_n x_n\n",
    "$$\n",
    "齐次表示\n",
    "$$\n",
    "f(x) = \\left[\n",
    "\\begin{matrix}\n",
    "\\theta_n &\n",
    "\\dots &\n",
    "\\theta_1 &\n",
    "\\theta_0\n",
    "\\end{matrix}\n",
    "\\right]\n",
    "\\left[\n",
    "\\begin{matrix}\n",
    "x_n \\\\\n",
    "\\vdots \\\\\n",
    "x_1 \\\\\n",
    "1\n",
    "\\end{matrix}\n",
    "\\right]\n",
    "$$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "我们原来的点的坐标为$(x, y)$,这里受限要理清楚两个点\n",
    "1. $x$要填充$1$，变成二维的数据，以适应齐次方程的形式\n",
    "2. $y$并不是最终的结果，应当算作是其中的一个参数，或者叫做$x_2$\n",
    "此处其实并不存在最终结果，都是基本的运算数据，新的数据形式应该为$(x_2, x_1, 1)$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "def create_data_with_const(mu, sigma, count):\n",
    "    basic_data = create_data(mu, sigma, count)\n",
    "    return np.hstack((basic_data, np.ones([count,1])))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 结果标记\n",
    "前面说明了，虽然点$(x,y)$之间或许存在关系，但不是我们需要关系，他们都是作为$X$的其中一个因变量。<br>\n",
    "真正的标签，也就是作为结果的指导，其实需要我们后续进行填充。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def creater_data_with_label(mu, sigma, count, label):\n",
    "    data = create_data_with_const(mu, sigma, count)\n",
    "    return np.hstack((data, np.ones([count,1]) * label))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 数据生成"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD4CAYAAAD1jb0+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3db4xcd33v8fd317ttZh2UeGwio3THokVUalVcbNEiJFTiC+K6UYEHRUibYBEq36zvrSwkdEVl6d5UV77lVqq4vg+S4FIHKzsVjSJxiSILFQVQeQRd34QkECqq1msCIX/WjSB2wI79vQ/OnO7smfObc87MmZlzZj4v6Wh2zp4557fHyff85vv7Z+6OiIjUz9ykCyAiIoNRABcRqSkFcBGRmlIAFxGpKQ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M3t7ZdQj4PhW8rxAubxXvbV7TvCr9XuCsmc0TPagecffHzexhM9tPlGe8APynCZYxy2eBR8zsk8BF4I8nXJ4sf1nRe3sb8GUzg+i/+b9196+a2T9SvfsbKmtV/7v9U6BtZovAvwCfoPP/W8XuayytvP+novc2k4bSi4jU1NSmUEREpp0CuIhITSmAi4jUlAK4iEhNKYCLiNSUAriISE0pgIuI1NT/B+QKbCj40jlNAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1.0\n"
     ]
    }
   ],
   "source": [
    "blue = creater_data_with_label([40, 60], [[5,0],[0,5]], 1000, 0)\n",
    "red = creater_data_with_label([60,40], [[5,0],[0,5]], 1000, 1)\n",
    "scatter_show(blue[:,0],blue[:,1], color='blue')\n",
    "scatter_show(red[:,0],red[:,1], color='red')\n",
    "plt.show()\n",
    "print(blue[0,-2])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# sigmod\n",
    "$$\n",
    "sigmod(x) = \\frac{1}{1 + e^{-x}}\n",
    "$$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAADuCAYAAAAp6fzCAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAf8UlEQVR4nO3deXxU533v8c9PoxWBALEIsZjd7EK2Cd6SeAsYsBNst7k2Sa63tNS9cdxcJ3acV9omcdrYfblpnd44sYlNHffmGie1nRCDwUu8byzGBsSOWCQWISGQ0D7Lc/+YgQgxQgPM6MyMvu/XS6+Zc84zo5+emfly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s/5Rtsfaj4lyJ/ByJ9u6o79O+/e78KnVnvaRmY0CLgA+irL5UjP71MxeNrMp3VUTXb82Xr+vbgGe7WSbV30WSxbFpd88nanJzF4DhkTZ9H3n3B86e1iUdQk7BDLGGhfQ+ZsI4HLn3H4zGwy8amZbnHNvJ6ouwrNd/phwv/wY+CnhAD3pKaI89pz7MZb+MrPvAwHgN508Tdz7K1qpUdad1ZQWiWBmvYHngW855+o7bP4YGOmcazCzecDvCc902h26em287LNs4EuE92478rLPYhGXfvM00J1zXziLh8U6zUDV8RkfzawYOJSIGs0sE7gJuOg0z7E/cnvIzF4kPIPlOQVUrH1nZr8CXoqyKSHTNcTQX7cB1wPXuMj/LaM8R9z7K4qkndLCzLIIh/lvnHMvdNzePuCdc8vN7BdmNtA5F8s8beckhtfGy2lA5gIfO+eqOm7wss+ILYvi0m+pOOSyFLjFzHLMbDThf2VXddLutsj92wiPRSbCF4AtzrnKaBvNLN/M+hy/T3iMb2OCajn+O4vbLd7Yye+LZUqHeNc1B/gu8CXnXFMnbbqrv5JySovIxWKeAjY75/6tkzZDIu0ws5mEP8eHE1lX5HfF8tp4OQ1Ip/9T9qrPImLJovh8Hrvry4qz+GLhRsL/arUCVZz8hcH3gZ2Ev2yY2279k0S+QAUGAK8D2yO3hQmq82ngrg7rhgLLI/fHAJ9GfsoIDz0kuu/+C9gArI+8KYo71hVZngdsi/Rld9S1g/A44SeRn8e97K9ofz9w1/HXk/B/gx+LbN9Auy/nE1jTZwn/V3t9u36a16GuuyN98ynwIXBZous63WvjdZ9Ffm8vwgHdt926bu8zwv+gHAD8kfz6emdZlIjPo5en/ouISByl4pCLiIhEoUAXEUkTCnQRkTShQBcRSRMKdBGRNKFAFxFJEwp0EZE08f8BnMNZ6OrnvKgAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from matplotlib.pyplot import MultipleLocator\n",
    "\n",
    "\n",
    "def basic_sigmod(x):\n",
    "    return 1.0 / (1 + np.power(np.e, -x))\n",
    "\n",
    "def basic_plt():\n",
    "    fig, ax = plt.subplots()\n",
    "    for name in ['top','left']:\n",
    "        ax.spines[name].set_color('none')\n",
    "    for name in ['bottom', 'right']:\n",
    "        ax.spines[name].set_position(('data', 0))\n",
    "\n",
    "basic_plt()\n",
    "\n",
    "def draw_sigmod():\n",
    "    X = np.linspace(-10,10,100)\n",
    "    plt.plot(X, basic_sigmod(X))\n",
    "    \n",
    "draw_sigmod()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 逻辑回归\n",
    "\n",
    "其中利用$sigmod$函数，然后变成了这样的形式\n",
    "$$\n",
    "g(z) = \\frac{1}{1+ e^{-f(x)}}\n",
    "$$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "def fx(_theta, _X):\n",
    "    res = np.dot(_X, _theta.T)\n",
    "    return res\n",
    "\n",
    "def gx(_theta, _X):\n",
    "    return basic_sigmod(fx(_theta, _X))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 损失函数和梯度下降\n",
    "\n",
    "## 损失函数\n",
    "$$\n",
    "J(\\theta) = - \\frac{1}{m} \\sum_{i=1}^{m}\\left(y_i \\log(g(x_i)) + (1- y_i)\\log(1 - g(x_i))\\right)\n",
    "$$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 梯度\n",
    "$$\n",
    "\\triangledown J(\\theta) = \\frac{1}{m}\\sum_{i=1}^{m}(g(x_i) - y_i)*x_{ij}\n",
    "$$\n",
    "其中的$j$，其实没有经过更多的遍历，只是多维的$X$的不同分量而已。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 下降策略\n",
    "\n",
    "$$\n",
    "\\theta_{i+1} = \\theta_i - \\eta \\triangledown J(\\theta_i)\n",
    "$$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 数据准备\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[39.9579989  58.57080557  1.          0.        ]\n",
      "[55.42447304 39.93024159  1.          1.        ]\n"
     ]
    }
   ],
   "source": [
    "data = np.vstack((blue, red))\n",
    "print(data[0])\n",
    "print(data[-1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "def grad(_theta, _X, pred_y):\n",
    "    _gx = gx(_theta, _X) - pred_y\n",
    "    return np.dot(_gx, _X)\n",
    "\n",
    "def loss(_theta, _X, _Y):\n",
    "    _gx = gx(_theta, _X)\n",
    "    return _Y * np.log(_gx) + (1 - _Y) * np.log(1 - _gx)\n",
    "\n",
    "def update_theta(grad, old_theta, lr):\n",
    "    return old_theta - grad * lr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "def draw_sigmod_scatter(_theta, _X, color):\n",
    "    _x = fx(_theta, _X)\n",
    "    _y = basic_sigmod(_x)\n",
    "    plt.scatter(_x, _y, color=color)\n",
    "    \n",
    "def draw_result(_theta):\n",
    "    draw_sigmod()\n",
    "    draw_sigmod_scatter(_theta, blue[1,:-1], color='blue')\n",
    "    draw_sigmod_scatter(_theta, red[-1,:-1], color='red')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "from IPython import display\n",
    "\n",
    "def batch_train(_data, batch_size, lr=[0.001,0.001,0.001], iters=100):\n",
    "    theta = np.ones(_data.shape[-1]-1).astype('float')\n",
    "    data_count = _data.shape[0]\n",
    "    data_index = np.arange(data_count)\n",
    "    _loss = []\n",
    "    for _ in range(iters):\n",
    "        batch_index = np.random.choice(data_index, batch_size)\n",
    "        batch_data = _data[batch_index]\n",
    "        batch_X = batch_data[:,:-1]\n",
    "        batch_Y = batch_data[:,-1]\n",
    "        _grad = grad(theta, batch_X, batch_Y)\n",
    "        theta = update_theta(_grad, theta, lr)\n",
    "        _loss.append(loss(theta, data[:,:-1], data[:,-1]).mean())\n",
    "        display.clear_output(wait=True)\n",
    "        plt.subplot(211)\n",
    "        draw_result(theta) \n",
    "        plt.subplot(212)\n",
    "        plt.plot(range(len(_loss)), _loss, label='loss')\n",
    "        plt.legend()\n",
    "        plt.show()\n",
    "    return theta"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXkAAAD4CAYAAAAJmJb0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3deXhc1X3/8fd3Rpsled+x8QbEYBKMQZilqUNK2GkI5EeAEOKyuUkhC08SfqTkl6ZP6tJAk7QECjWEBopZ0kASyppAUkjzAMEY2xgbgzEYZBtbtsGLttm+vz/ulTSWZ7A80mikO5/X88wzc7e53zkz89XRuWfOMXdHRESiKVbqAEREpHiU5EVEIkxJXkQkwpTkRUQiTEleRCTCKkodQLYxY8b4tGnTSh2GiMig8tJLL21197G5tg2oJD9t2jSWLFlS6jBERAYVM1ufb5uaa0REIkxJXkQkwgpK8mZ2p5ltMbOVebabmd1kZmvNbIWZHdW7MEVEpBCF1uR/Bpz2IdtPBw4JbwuAWws8j4hEweLFMG0axGLB/eLFpY6obBR04dXdnzWzaR+yy9nA3R4MjPO8mY0ws4nuvqmQ84nIILZ4MSxYAC0tZDCSjRtIXvlVkikjee65JNNOOu2kMhnSGSeVcdIdN3cy4eOMQ8Y9vAWP3R13spYJ1kG4vuPxnmN0uUOwJXwcbvY99ula2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83sPjOriUrZDIokb2Zx4BbgdGAWcKGZzSptVCWVAr7h7ocBxwFXhuVxLfC0ux8CPB0ul6OvAauzllUugX8FnnD3Q4HZBGVU9mVjZpOArwIN7v5RIA5cQETKZlAkeWAusNbd17l7ArgfOLvEMZWMu29y96Xh410EX9ZJBGVyV7jbXcBnShNh6ZjZZOBM4I6s1SoXs2HAPOCnAO6ecPcPUNl0qACGmFkFUAtsJCJlM1iS/CTg3azlxnBd2TOzacAc4AVgvLtvguAPATCudJGVzL8A1wCZrHUqF5gBNAH/ETZl3WFmdahscPcNwD8D7wCbgB3u/hsiUjaDJclbjnVl3/fTzOqBB4Gvu/vOUsdTamZ2FrDF3V8qdSwDUAVwFHCru88BmhmkzQ99LWxrPxuYDhwA1JnZF0obVd8ZLEm+ETgwa3kywb9TZcvMKgkS/GJ3fyhcvdnMJobbJwJbShVfifwZ8Gkze5ugSe8vzOweVC4QfIca3f2FcPkXBElfZQOfAt5y9yZ3TwIPAScQkbIZLEn+ReAQM5tuZlUEF0UeLnFMJWNmRtC2utrdf5S16WFgfvh4PvDr/o6tlNz92+4+2d2nEXxGfufuX6DMywXA3d8D3jWzmeGqk4BVqGwgaKY5zsxqw+/WSQTXuSJRNoPmF69mdgZBe2scuNPdF5Y4pJIxs48DfwBeoavt+W8J2uV/Dkwh+OCe5+7bSxJkiZnZicA33f0sMxuNygUzO5LggnQVsA64hKCip7Ix+3vgfIKeay8DlwP1RKBsBk2SFxGR/TdYmmtERKQASvIiIhGmJC8iEmFK8iIiEaYkLyISYUryIiIRpiQvIhJh/x8Xcd2ptGVTEwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "batch_train(data, 10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
